<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="theme-color" content="#33474d">
	<title>zabbix自动发现实现批量监控docker状态 | 失落的乐章</title>
	<link rel="stylesheet" href="/css/style.css" />
	
      <link rel="alternate" href="/atom.xml" title="失落的乐章" type="application/atom+xml">
    
</head>

<body>

	<header class="header">
		<nav class="header__nav">
			
				<a href="/archives" class="header__link">Archive</a>
			
				<a href="/tags" class="header__link">Tags</a>
			
				<a href="/atom.xml" class="header__link">RSS</a>
			
		</nav>
		<h1 class="header__title"><a href="/">失落的乐章</a></h1>
		<h2 class="header__subtitle">技术面前，永远都是学生。</h2>
	</header>

	<main>
		<article>
	
		<h1>zabbix自动发现实现批量监控docker状态</h1>
	
	<div class="article__infos">
		<span class="article__date">2017-10-12</span><br />
		
		
			<span class="article__tags">
			  	<a class="article__tag-link" href="/tags/Zabbix/">Zabbix</a>
			</span>
		
	</div>

	

	
		<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;最近在搞zabbix监控docker以及docker内部应用状态信息，网上找的资料好少，只找到了一个大神的一篇文章，用的是python实现监控docker容器的基本状态，在他给的脚本基础上进行修改，另外，增加了docker内部常用应用的状态监控，目前在测试环境上部署成功了，具体还需要在线上环境部署后才能检验出效果如何。</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;首先，介绍下该监控套件有三个脚本，一个是自动发现主机上的docker容器脚本，另一个是用python写的获取每个docker容器的系统状态，包括CPU使用率，内存使用率以及网络资源使用率，最后这个脚本添加了一些我公司常用的应用的状态监控，包括应用占用内存，cpu资源以及进程的存活状态，至于读者们需要监控其他docker里面的应用，可以依照我的脚本来进行修改。</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;首先，需要编辑自动发现docker中容器个数的脚本，内容如下：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div></pre></td><td class="code"><pre><div class="line">cat /usr/<span class="built_in">local</span>/zabbix/scripts/docker_low_discovery.sh </div><div class="line"></div><div class="line"><span class="meta">#!/bin/bash</span></div><div class="line"><span class="comment">#Fucation:docker low-level discovery</span></div><div class="line"><span class="function"><span class="title">docker</span></span>() &#123;</div><div class="line"> port=($(sudo docker ps -a|grep -v <span class="string">"CONTAINER ID"</span>|awk <span class="string">'&#123;print $NF&#125;'</span>))</div><div class="line"> <span class="built_in">printf</span> <span class="string">'&#123;\n'</span></div><div class="line"> <span class="built_in">printf</span> <span class="string">'\t"data":[\n'</span></div><div class="line"> <span class="keyword">for</span> key <span class="keyword">in</span> <span class="variable">$&#123;!port[@]&#125;</span></div><div class="line"> <span class="keyword">do</span></div><div class="line"> <span class="keyword">if</span> [[ <span class="string">"<span class="variable">$&#123;#port[@]&#125;</span>"</span> -gt 1 &amp;&amp; <span class="string">"<span class="variable">$&#123;key&#125;</span>"</span> -ne <span class="string">"<span class="variable">$(($&#123;#port[@]&#125;-1)</span>)"</span> ]];<span class="keyword">then</span></div><div class="line"> <span class="built_in">printf</span> <span class="string">'\t &#123;\n'</span></div><div class="line"> <span class="built_in">printf</span> <span class="string">"\t\t\t\"&#123;#CONTAINERNAME&#125;\":\"<span class="variable">$&#123;port[$&#123;key&#125;</span>]&#125;\"&#125;,\n"</span></div><div class="line">  </div><div class="line"> <span class="keyword">else</span> [[ <span class="string">"<span class="variable">$&#123;key&#125;</span>"</span> -eq <span class="string">"((<span class="variable">$&#123;#port[@]&#125;</span>-1))"</span> ]]</div><div class="line"> <span class="built_in">printf</span> <span class="string">'\t &#123;\n'</span></div><div class="line"> <span class="built_in">printf</span> <span class="string">"\t\t\t\"&#123;#CONTAINERNAME&#125;\":\"<span class="variable">$&#123;port[$&#123;key&#125;</span>]&#125;\"&#125;\n"</span></div><div class="line">  </div><div class="line"> <span class="keyword">fi</span></div><div class="line"> <span class="keyword">done</span></div><div class="line">  </div><div class="line"> <span class="built_in">printf</span> <span class="string">'\t ]\n'</span></div><div class="line"> <span class="built_in">printf</span> <span class="string">'&#125;\n'</span></div><div class="line">&#125;</div><div class="line"><span class="keyword">case</span> <span class="variable">$1</span> <span class="keyword">in</span></div><div class="line">docker)</div><div class="line">docker</div><div class="line">;;</div><div class="line">*)</div><div class="line"><span class="built_in">echo</span> <span class="string">"Usage:`basename <span class="variable">$0</span>` &#123;docker&#125;"</span></div><div class="line">;;</div><div class="line"><span class="keyword">esac</span></div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;上面这个脚本是用来获取到docker里面应用的容器，并对其进行json化输出的，效果如下：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div></pre></td><td class="code"><pre><div class="line">sh /usr/<span class="built_in">local</span>/zabbix/scripts/docker_low_discovery.sh docker</div><div class="line">&#123;</div><div class="line"><span class="string">"data"</span>:[</div><div class="line"> &#123;</div><div class="line"><span class="string">"&#123;#CONTAINERNAME&#125;"</span>:<span class="string">"hopeful_brown"</span>&#125;,</div><div class="line"> &#123;</div><div class="line"><span class="string">"&#123;#CONTAINERNAME&#125;"</span>:<span class="string">"happy_einstein"</span>&#125;</div><div class="line"> ]</div><div class="line">&#125;</div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;这样就能被zabbix_server获取到了，然后是python脚本,使用python获取docker的参数需要使用一个扩展包，可以通过pip或者easy_install安装docker-py扩展：</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;pip install docker-py或者easy_install docker-py或者不想这样安装的话可以去    python官网下载docker-py的安装包，解压后使用docker docker-py-1.4.0/setup.py     install命令安装，扩展包我将会打包放在附件中。</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;下面是python脚本：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div><div class="line">34</div><div class="line">35</div><div class="line">36</div><div class="line">37</div><div class="line">38</div><div class="line">39</div><div class="line">40</div><div class="line">41</div><div class="line">42</div><div class="line">43</div><div class="line">44</div></pre></td><td class="code"><pre><div class="line">cat /usr/<span class="built_in">local</span>/zabbix/scripts/docker_monitor.py </div><div class="line"><span class="comment">#!/usr/bin/env python</span></div><div class="line"><span class="comment">#-*- coding: utf-8 -*-</span></div><div class="line"><span class="comment">#author:Xianglin Hu</span></div><div class="line"><span class="comment">#email: a714585725@qq.com</span></div><div class="line">from docker import Client</div><div class="line">import sys</div><div class="line">import subprocess</div><div class="line">import os</div><div class="line"> </div><div class="line">def check_container_stats(container_name,collect_item):</div><div class="line"> container_collect=docker_client.stats(container_name)</div><div class="line"> old_result=<span class="built_in">eval</span>(container_collect.next())</div><div class="line"> new_result=<span class="built_in">eval</span>(container_collect.next())</div><div class="line"> container_collect.close()</div><div class="line"> <span class="keyword">if</span> collect_item == <span class="string">'cpu_total_usage'</span>:</div><div class="line"> result=new_result[<span class="string">'cpu_stats'</span>][<span class="string">'cpu_usage'</span>][<span class="string">'total_usage'</span>] - old_result[<span class="string">'cpu_stats'</span>][<span class="string">'cpu_usage'</span>][<span class="string">'total_usage'</span>]</div><div class="line"> <span class="keyword">elif</span> collect_item == <span class="string">'cpu_system_usage'</span>:</div><div class="line"> result=new_result[<span class="string">'cpu_stats'</span>][<span class="string">'system_cpu_usage'</span>] - old_result[<span class="string">'cpu_stats'</span>][<span class="string">'system_cpu_usage'</span>]</div><div class="line"> <span class="keyword">elif</span> collect_item == <span class="string">'cpu_percent'</span>:</div><div class="line"> cpu_total_usage=new_result[<span class="string">'cpu_stats'</span>][<span class="string">'cpu_usage'</span>][<span class="string">'total_usage'</span>] - old_result[<span class="string">'cpu_stats'</span>][<span class="string">'cpu_usage'</span>][<span class="string">'total_usage'</span>]</div><div class="line"> cpu_system_uasge=new_result[<span class="string">'cpu_stats'</span>][<span class="string">'system_cpu_usage'</span>] - old_result[<span class="string">'cpu_stats'</span>][<span class="string">'system_cpu_usage'</span>]</div><div class="line"> cpu_num=len(old_result[<span class="string">'cpu_stats'</span>][<span class="string">'cpu_usage'</span>][<span class="string">'percpu_usage'</span>])</div><div class="line"> result=round((<span class="built_in">float</span>(cpu_total_usage)/<span class="built_in">float</span>(cpu_system_uasge))*cpu_num*100.0,2)</div><div class="line"> <span class="keyword">elif</span> collect_item == <span class="string">'mem_usage'</span>:</div><div class="line"> result=new_result[<span class="string">'memory_stats'</span>][<span class="string">'usage'</span>]</div><div class="line"> <span class="keyword">elif</span> collect_item == <span class="string">'mem_limit'</span>:</div><div class="line"> result=new_result[<span class="string">'memory_stats'</span>][<span class="string">'limit'</span>]</div><div class="line"> <span class="keyword">elif</span> collect_item == <span class="string">'mem_percent'</span>:</div><div class="line"> mem_usage=new_result[<span class="string">'memory_stats'</span>][<span class="string">'usage'</span>]</div><div class="line"> mem_limit=new_result[<span class="string">'memory_stats'</span>][<span class="string">'limit'</span>]</div><div class="line"> result=round(<span class="built_in">float</span>(mem_usage)/<span class="built_in">float</span>(mem_limit)*100.0,2)</div><div class="line"> <span class="keyword">elif</span> collect_item == <span class="string">'network_rx_bytes'</span>:</div><div class="line"> network_check_command=<span class="string">""</span><span class="string">"sudo /usr/bin/docker exec %s cat /proc/net/dev|sed -n 3p|awk '&#123;print <span class="variable">$2</span>,<span class="variable">$10</span>&#125;'"</span><span class="string">""</span>%container_name</div><div class="line"> result=os.popen(network_check_command).<span class="built_in">read</span>().split()[0]</div><div class="line"> <span class="keyword">elif</span> collect_item == <span class="string">'network_tx_bytes'</span>:</div><div class="line"> network_check_command=<span class="string">""</span><span class="string">"sudo /usr/bin/docker exec %s cat /proc/net/dev|sed -n 3p|awk '&#123;print <span class="variable">$2</span>,<span class="variable">$10</span>&#125;'"</span><span class="string">""</span>%container_name</div><div class="line"> result=os.popen(network_check_command).<span class="built_in">read</span>().split()[1]</div><div class="line"> <span class="built_in">return</span> result</div><div class="line"><span class="keyword">if</span> __name__ == <span class="string">"__main__"</span>:</div><div class="line"> docker_client = Client(base_url=<span class="string">'unix://var/run/docker.sock'</span>, version=<span class="string">'1.17'</span>)</div><div class="line"> container_name=sys.argv[1]</div><div class="line"> collect_item=sys.argv[2]</div><div class="line"> <span class="built_in">print</span> check_container_stats(container_name,collect_item)</div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;这里面使用到了docker里面的Client类，获取到某个docker容器的当前状态信息，然后进行运算，返回运算结果。但是容器当前信息那个dict中的network的key获取到的信息不准确，于是我使用了docker exec命令来获取docker容器内部的网络流量信息。这也是在大神的基础上进行改进的地方，这里的改进将python脚本的执行时间缩短了，将有助于server获取duocker容器信息时减少长连接的数量，提升zabbix_server的性能。这里的docker exec命令将会在下一个脚本中大量使用来获取docker容器中的应用状态信息。</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;下面是获取容器应用状态信息的脚本：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div></pre></td><td class="code"><pre><div class="line">cat docker_processmonitor.sh </div><div class="line"></div><div class="line"><span class="meta">#!/bin/bash</span></div><div class="line"><span class="comment">#license:GPL</span></div><div class="line"><span class="comment">#mail:a714585725@qq.com</span></div><div class="line"><span class="comment">#date:2015.09.22</span></div><div class="line"><span class="function"><span class="title">processmem</span></span>()&#123;</div><div class="line"> sudo /usr/bin/docker <span class="built_in">exec</span> <span class="variable">$1</span> ps aux|grep <span class="variable">$2</span>|grep -v <span class="string">"grep"</span>|grep -v <span class="string">"processstatus.sh"</span>|awk <span class="string">'&#123;sum+=$6&#125;; END&#123;print sum&#125;'</span></div><div class="line">&#125;</div><div class="line"><span class="function"><span class="title">processcpu</span></span>()&#123;</div><div class="line"> sudo /usr/bin/docker <span class="built_in">exec</span> <span class="variable">$1</span> ps aux|grep <span class="variable">$2</span>|grep -v <span class="string">"grep"</span>|grep -v <span class="string">"processstatus.sh"</span>|awk <span class="string">'&#123;sum+=$3&#125;; END&#123;print sum&#125;'</span></div><div class="line">&#125;</div><div class="line"><span class="function"><span class="title">processport</span></span>()&#123;</div><div class="line"> sudo /usr/bin/docker <span class="built_in">exec</span> <span class="variable">$1</span> ss -antlp|grep <span class="variable">$2</span>|grep LISTEN|wc -l</div><div class="line">&#125;</div><div class="line"><span class="keyword">case</span> <span class="string">"<span class="variable">$3</span>"</span> <span class="keyword">in</span></div><div class="line">mem)</div><div class="line">processmem <span class="variable">$1</span> <span class="variable">$2</span></div><div class="line">;;</div><div class="line">cpu)</div><div class="line">processcpu <span class="variable">$1</span> <span class="variable">$2</span></div><div class="line">;;</div><div class="line">port)</div><div class="line">processport <span class="variable">$1</span> <span class="variable">$2</span></div><div class="line">;;</div><div class="line">*)</div><div class="line"><span class="built_in">echo</span> <span class="string">"Usage: <span class="variable">$0</span> &#123;docker_containername&#125;&#123;processname&#125;&#123;mem|cpu|port&#125;"</span></div><div class="line">;;</div><div class="line"><span class="keyword">esac</span></div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;这个脚本使用了一个case来判断需要获取的docker容器的名称以及该容器中应用的状态信息，只不过这里获取docker容器状态信息使用的是docker exec命令来进行获取。另外这里面添加了对于应用是否存活的状态监测，那就是检测该应用是否侦听了网络端口，假如该应用侦听的网络端口个数为0的话，可以认为该应用存在异常。可以根据自己需求修改相应应用的监控。</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;由于docker是以root权限来启用的，而zabbix监控是使用zabbix用户来执行的，所以需要给予zabbix用户相应的权限，需要编辑visudo：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="built_in">echo</span> <span class="string">"zabbix ALL=(root) 	NOPASSWD:/bin/docker,/usr/bin/python,/usr/local/zabbix/scripts/docker_monitor.py,/usr/local/zabbix/scripts/docker_low_discovery.sh,/usr/local/zabbix/scripts/docker_processmonitor.sh"</span>&gt;&gt;/etc/sudoers</div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;并且还需要注释掉这条记录：#Defaults    requiretty（PS：注意，这条记录是要求使用sudo命令时需要有终端界面，注释掉这一条之后就可以不需要终端执行sudo命令了。）</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;然后就是编辑zabbix_agentd.conf文件,添加下面几行：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line">tail -3 /usr/<span class="built_in">local</span>/zabbix/etc/zabbix_agentd.conf</div><div class="line"></div><div class="line">UserParameter=docker_low_discovery[*],/bin/bash /usr/<span class="built_in">local</span>/zabbix/scripts/docker_low_discovery.sh <span class="variable">$1</span></div><div class="line">UserParameter=docker_stats[*],sudo /usr/bin/python /usr/<span class="built_in">local</span>/zabbix/scripts/docker_monitor.py <span class="variable">$1</span> <span class="variable">$2</span></div><div class="line">UserParameter=docker_process[*],/bin/bash /usr/<span class="built_in">local</span>/zabbix/scripts/docker_processmonitor.sh <span class="variable">$1</span> <span class="variable">$2</span> <span class="variable">$3</span></div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;保存配置并重启zabbix_agentd服务，然后修改脚本的属主属组以及权限：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">chown zabbix.zabbix /usr/<span class="built_in">local</span>/zabbix/scripts/*</div><div class="line">chmod 755 /usr/<span class="built_in">local</span>/zabbix/scripts/*</div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;然后可以在zabbix_server端测试是否能够获取到相应的数据：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div></pre></td><td class="code"><pre><div class="line">[root@test1 ~]<span class="comment"># /usr/local/zabbix-2.4.4/bin/zabbix_get -s x.x.x.x -k"docker_low_discovery[docker]"</span></div><div class="line">&#123;</div><div class="line"><span class="string">"data"</span>:[</div><div class="line"> &#123;</div><div class="line"><span class="string">"&#123;#CONTAINERNAME&#125;"</span>:<span class="string">"hopeful_brown"</span>&#125;,</div><div class="line"> &#123;</div><div class="line"><span class="string">"&#123;#CONTAINERNAME&#125;"</span>:<span class="string">"happy_einstein"</span>&#125;</div><div class="line"> ]</div><div class="line">&#125;</div><div class="line">[root@test1 ~]<span class="comment"># /usr/local/zabbix-2.4.4/bin/zabbix_get -s x.x.x.x -k"docker_stats[happy_einstein,network_tx_bytes]"</span></div><div class="line">9664252</div><div class="line">[root@test1 ~]<span class="comment"># /usr/local/zabbix-2.4.4/bin/zabbix_get -s x.x.x.x -k"docker_process[happy_einstein,nginx,port]"</span></div><div class="line">2</div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;这里的IP地址就用x.x.x.x代替了，这里应该填写客户端的IP地址。如上所示，能够正确获取到agentd的数据以后，然后就需要在zabbix_server这边配置监控模版了</p>
<p><figure class="figure"><img src="https://github.com/hcldirgit/image/blob/master/zabbix%E8%87%AA%E5%8A%A8%E5%8F%91%E7%8E%B0%E5%AE%9E%E7%8E%B0%E6%89%B9%E9%87%8F%E7%9B%91%E6%8E%A7docker%E7%8A%B6%E6%80%81/01.jpeg?raw=true" alt=""></figure></p>
<p><figure class="figure"><img src="https://github.com/hcldirgit/image/blob/master/zabbix%E8%87%AA%E5%8A%A8%E5%8F%91%E7%8E%B0%E5%AE%9E%E7%8E%B0%E6%89%B9%E9%87%8F%E7%9B%91%E6%8E%A7docker%E7%8A%B6%E6%80%81/02.jpeg?raw=true" alt=""></figure></p>
<p><figure class="figure"><img src="https://github.com/hcldirgit/image/blob/master/zabbix%E8%87%AA%E5%8A%A8%E5%8F%91%E7%8E%B0%E5%AE%9E%E7%8E%B0%E6%89%B9%E9%87%8F%E7%9B%91%E6%8E%A7docker%E7%8A%B6%E6%80%81/03.jpeg?raw=true" alt=""></figure></p>
<p><figure class="figure"><img src="https://github.com/hcldirgit/image/blob/master/zabbix%E8%87%AA%E5%8A%A8%E5%8F%91%E7%8E%B0%E5%AE%9E%E7%8E%B0%E6%89%B9%E9%87%8F%E7%9B%91%E6%8E%A7docker%E7%8A%B6%E6%80%81/04.jpeg?raw=true" alt=""></figure></p>
<p><figure class="figure"><img src="https://github.com/hcldirgit/image/blob/master/zabbix%E8%87%AA%E5%8A%A8%E5%8F%91%E7%8E%B0%E5%AE%9E%E7%8E%B0%E6%89%B9%E9%87%8F%E7%9B%91%E6%8E%A7docker%E7%8A%B6%E6%80%81/05.jpeg?raw=true" alt=""></figure></p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;上面这些显示的是监控的结果，也可以根据自己的需求来进行修改</p>

	

	
		<span class="different-posts"><a href="/2017/10/12/Zabbix/26. zabbix自动发现实现批量监控docker状态/" onclick="window.history.go(-1); return false;">⬅️ Go back </a></span>

	

</article>

	</main>

	<footer class="footer">
	<div class="footer-content">
		
	      <div class="footer__element">
	<p>Hi there, <br />welcome to my Blog glad you found it. Have a look around, will you?</p>
</div>

	    
	      <div class="footer__element">
	<h5>Check out</h5>
	<ul class="footer-links">
		<li class="footer-links__link"><a href="/archives">Archive</a></li>
		
		  <li class="footer-links__link"><a href="/atom.xml">RSS</a></li>
	    
		<li class="footer-links__link"><a href="/about">about page</a></li>
		<li class="footer-links__link"><a href="/tags">Tags</a></li>
		<li class="footer-links__link"><a href="/categories">Categories</a></li>
	</ul>
</div>

	    

		<div class="footer-credit">
			<span>© 2017 失落的乐章 | Powered by <a href="https://hexo.io/">Hexo</a> | Theme <a href="https://github.com/HoverBaum/meilidu-hexo">MeiliDu</a></span>
		</div>

	</div>


</footer>



</body>

</html>
